package com.zaydanwu.cla.controller.students;

import com.zaydanwu.cla.model.Reply;
import com.zaydanwu.cla.model.result.ApiResult;
import com.zaydanwu.cla.service.ReplyService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @BelongsProject: cla
 * @BelongsPackage: com.zaydanwu.cla.controller.students
 * @Author: zaydanwu
 * @CreateTime: 2019-01-05 13:15
 * @Description:
 */
@RestController
@RequestMapping("/cla/api")
public class ReplyController {

    @Resource
    private ReplyService replyService;

    @RequestMapping("/saveReply")
    public ApiResult<Object> saveReply(@RequestBody Reply record) {
        return ApiResult.success(replyService.saveReply(record));
    }

    @RequestMapping("/deleteByCommentId")
    public ApiResult<Object> deleteByCommentId(@RequestParam Integer commentId) {
        return ApiResult.success(replyService.deleteByCommentId(commentId));
    }

}
